package com.lapian.designmode.observer.mashibing.v3;

/**
 * 创建日期：2021/11/15 10:16
 *加入一个观察者
 * @author tony.sun
 * 类说明：
 */
class Child {
    private boolean cry=false;
    private Dad dad=new Dad();
    public boolean isCry(){
        return cry;
    }
    public void wakeUp(){
        System.out.println("Waked Up! Crying wuwuwuwuw……");
        cry=true;
        dad.feed();

    }

}
class Dad{
    public void feed(){
        System.out.println("dad feeding");
    }
}
public class Main {
    public static void main(String[] args) {

    }
}
